CONTENTS | INDEX | PREV | NEXT
 DoRexxCommand

 FUNCTION
 Parse an incomming ARexx command (DICE)

 SYNTAX
 #include <lib/rexx.h>
 /* YOU DECLARE THIS IN YOUR CODE */
 long DoRexxCommand(msg, port, arg0, pres)
 void *msg;
 struct MsgPort *port;
 char *arg0;
 char **pres;
 {
    long rc = 0;
    *pres = "return string";
    return(rc);
 }

 DESCRIPTION
 DoRexxCommand is a routine that YOU supply to process incomming ARexx
 requests.  DICE will call your routine for any requests it processes
 with ProcessRexxCommands as well as for any requests that come in
 during processing of a PlaceRexxCommand. DICE presets pres to NULL.

 To return an error simply return a non-zero error code.

 To return a string, set pres to point to the string and return 0.
 DICE will make a copy of the string to return to ARexx.  Note that
 the application requesting the string will not see if if they have
 not requested 'OPTIONS RESULTS' as part of their processing.

 ## WARNING: Because your procedure must return before DICE can
 ## process the string, you MUST not assign pres to any local stack
 ## variables.  The resulting crash can be quite spectacular.

 INPUTS
 void *msg;      Incomming ARexx message if necessary.

 struct MsgPort *port; Port that the message came in on.

 char *arg0;     The ARexx command that is to be processed.  Your
             code must parse this in whatever way you want.

 char **pres;        Place to store result string.

 RESULTS
 int rc;         Return code to be passed to the application
             requesting the ARexx command.